﻿using FMStudio.Documents.ProjectDocument;
using FMStudio.Templates.DesignTool.Application.Properties;
using System;
using System.Collections.ObjectModel;

namespace FMStudio.Templates.DesignTool.Application.Models
{
    public class ProjectDocumentItem : ToolboxItem
    {
        #region Fields
        private ProjectDocumentType documentType;
        private readonly ObservableCollection<ToolboxItem> items;
        private string projectName;
        private string targetName;
        #endregion

        public ProjectDocumentItem(ProjectDocumentType documentType)
            : base(Resources.Project)
        {
            if (documentType == null) { throw new ArgumentException("documentType"); }
            this.documentType = documentType;
        }

        #region Properties
        public ProjectDocumentType DocumentType
        {
            get { return this.documentType; }
            set
            {
                if (this.documentType != value)
                {
                    this.documentType = value;
                    RaisePropertyChanged("DocumentType");
                }
            }
        }

        public ObservableCollection<ToolboxItem> Items { get { return this.items; } }

        public string ProjectName
        {
            get { return this.projectName; }
            set
            {
                if (this.projectName != value)
                {
                    this.projectName = value;
                    RaisePropertyChanged("ProjectName");
                }
            }
        }

        public string TargetName
        {
            get { return this.targetName; }
            set
            {
                if (this.targetName != value)
                {
                    this.targetName = value;
                    RaisePropertyChanged("TargetName");
                }
            }
        }
        #endregion
    }
}
